﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Site.Models.Interfaces;

namespace Site.Models
{
    public class FakeTasksRepository : TasksRepository
    {
        List<Task> db;
        public FakeTasksRepository()
        {
            db = new List<Task>
            {
                new Task { Id = 1, Cost = 5, Title = "Task 1" },
                new Task { Id = 2, Cost = 3, Title = "Task 2" },
                new Task { Id = 3, Cost = 7, Title = "Task 3" },
                new Task { Id = 4, Cost = 12, Title = "Task 4" }
            };
        }

        public Task GetTask(int id)
        {
            return db.FirstOrDefault(t => t.Id == id);
        }

        public IList<Task> Tasks
        {
            get { return db; }
        }
    }
}